package com.nursinghome.admin.service.impl;

import com.nursinghome.admin.mapper.IndexMapper;
import com.nursinghome.admin.service.IndexService;
import com.nursinghome.bean.AttendanceVO;
import com.nursinghome.bean.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class IndexServiceImpl implements IndexService {
    @Autowired
    private IndexMapper indexMapper;
    @Override
    public List<Map<String, Object>> selectMedicalAndElderly() {
        return indexMapper.selectMedicalAndElderly();
    }

    @Override
    public List<Goods> selectDishTop5() {
        return indexMapper.selectDishTop5();
    }

    @Override
    public AttendanceVO holiday() {
        Integer holiday = indexMapper.holiday();
        Integer totalpeople = indexMapper.medicalTotal();
        AttendanceVO attendanceVO = new AttendanceVO();

        attendanceVO.setHolidayNumber(holiday);
        attendanceVO.setTotalpeople(totalpeople);

        return attendanceVO;
    }
}
